package lianxi5.BigInteger;

import java.math.BigInteger;
import java.util.Random;

public class test {
    public static void main(String[] args) {
        Random r = new Random();
        //获取一个随机大整数
        BigInteger bg1 = new BigInteger(10,r);
        System.out.println(bg1);

        //获取一个指定的大整数
        //字符串必须为整数
        BigInteger bg2 = new BigInteger("-12345678901234567890");
        System.out.println(bg2);

        //获取指定进制的大整数
        BigInteger bg3 = new BigInteger("654" , 7);
        System.out.println(bg3);

        //静态方法获取BigInteger的对象
        BigInteger bg4 = BigInteger.valueOf(100);
        System.out.println(bg4);



    }

}
